﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Csla;

namespace Asah.SiteWorx.Commerce
{
    [Serializable()]
    public class ShipToInfo : Csla.ReadOnlyBase<ShipToInfo>
    {
        private int _orderId;
        private ShippingMethod _shippingMethod;
        private string _company;
        private string _firstName;
        private string _lastName;
        private string _address1;
        private string _address2;
        private string _city;
        private string _state;
        private string _zip;
        private string _phone;
        private string _email;

        public int OrderId
        {
            get
            {
                return _orderId;
            }
            internal set
            {
                _orderId = value;
            }
        }

        public ShippingMethod ShippingMethod
        {
            get
            {
                return _shippingMethod;
            }
            internal set
            {
                _shippingMethod = value;
            }
        }

        public string Company
        {
            get
            {
                return _company;
            }
            internal set
            {
                _company = value;
            }
        }

        public string FirstName
        {
            get
            {
                return _firstName;
            }
            internal set
            {
                _firstName = value;
            }
        }

        public string LastName
        {
            get
            {
                return _lastName;
            }
            internal set
            {
                _lastName = value;
            }
        }

        public string Address1
        {
            get
            {
                return _address1;
            }
            internal set
            {
                _address1 = value;
            }
        }

        public string Address2
        {
            get
            {
                return _address2;
            }
            internal set
            {
                _address2 = value;
            }
        }

        public string City
        {
            get
            {
                return _city;
            }
            internal set
            {
                _city = value;
            }
        }

        public string State
        {
            get
            {
                return _state;
            }
            internal set
            {
                _state = value;
            }
        }

        public string Zip   
        {
            get
            {
                return _zip;
            }
            internal set
            {
                _zip = value;
            }
        }

        public string Phone
        {
            get
            {
                return _phone;
            }
            internal set
            {
                _phone = value;
            }
        }

        public string Email
        {
            get
            {
                return _email;
            }
            internal set
            {
                _email = value;
            }
        }

        public override string ToString()
        {
            return _orderId.ToString();
        }

        protected override object GetIdValue()
        {
            return _orderId;
        }

        internal ShipToInfo()
        {
            // require use of factory methods
        }

        internal ShipToInfo(int orderId, ShippingMethod shippingMethod, string company, string firstName,
                            string lastName, string address1, string address2, string city, string state,
                            string zip, string phone, string email)
        {
            _orderId = orderId;
            _shippingMethod = shippingMethod;
            _company = company;
            _firstName = firstName;
            _lastName = lastName;
            _address1 = address1;
            _address2 = address2;
            _city = city;
            _state = state;
            _zip = zip;
            _phone = phone;
            _email = email;
        }
    }
}
